#!/usr/bin/python


if __name__ == '__main__':
    from git import Git
    from errors import GitCommandError
    import os

def main():
    git = Git()

    kwargs1 = {}
    kwargs1['command'] = 'init'
    kwargs1['dir'] = './download'
    
    if False==os.path.exists( './download' ):
        os.mkdir( './download' )
    try:
        ret = git.run( kwargs1 )
        print 'git run result : ', ret
    except GitCommandError, e:
        print e.error_info


    kwargs = {}
    kwargs['command'] = 'svn clone'
    kwargs['target'] = 'http://daemonserver.googlecode.com/svn/trunk/'
    kwargs['dir'] = './download'
    
    if False==os.path.exists( './download' ):
        os.mkdir( './download' )
    try:
        ret = git.run( kwargs )
        print 'git run result : ', ret
    except GitCommandError, e:
        print e.error_info

if __name__ == '__main__':
    main()
